package sessions;

import java.util.List;

import javax.ejb.Remote;

import entities.Feedback;
import entities.HelpRequest;
import entities.User;
import exceptions.FeedbackException;
import exceptions.HelpRequestException;

@Remote
public interface HelpManagerRemote {

	/**
	 * @param fromUser
	 *            User entity
	 * @param toUser
	 *            User entity
	 * @param message
	 *            attached text
	 * @throws HelpRequestException
	 */
	public void request(User fromUser, User toUser, String message)
			throws HelpRequestException;

	/**
	 * @param username
	 *            User entity
	 * @return the list of incoming requests
	 */
	public List<HelpRequest> fetchIncoming(String username);

	/**
	 * @param username
	 *            User entity
	 * @return the list of outgoing requests
	 */
	public List<HelpRequest> fetchOutgoing(String username);

	/**
	 * @param id
	 * @return
	 */
	public HelpRequest fetch(int id);

	/**
	 * @param hr
	 *            HelpRequest to change status
	 */
	public void accept(HelpRequest hr);

	/**
	 * @param hr
	 *            HelpRequest to change status
	 */
	public void refuse(HelpRequest hr);

	/**
	 * @param evaluation
	 * @param comment
	 * @param hr
	 * @throws FeedbackException
	 */
	public void addFeedback(int evaluation, String comment, HelpRequest hr)
			throws FeedbackException;

	/**
	 * @param username
	 * @return
	 */
	public List<Feedback> fetchReceivedFeedback(String username);

	/**
	 * @return
	 */
	public List<HelpRequest> fetchRequestWithFeedback();

}
